<!-- App.vue -->
<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const _isMobile = () => {
  let flag = navigator.userAgent.match(
    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  );
  console.log(flag);

  localStorage.setItem("isMobile", flag != null ? "1" : "0");
  return flag;
};

onMounted(() => {
  if (route.path === "/" || route.path === "/mobile_home") {
    if (_isMobile()) {
      router.replace("/mobile_home");
    } else {
      router.replace("/");
    }
  }
});
</script>

<style>
/* Add your styles here */
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1 {
  /* font-size: 37px; */
}
h3 {
  /* font-size: 22px; */
}
</style>
